Skip to content

fix(harness): wrap plugin hooks.json events under a top-level "hooks" key - #56

Merged
robercano-ghbot merged 1 commit into
mainfrom
fix/plugin-hooks-json-schema
Jul 6, 2026
Merged

fix(harness): wrap plugin hooks.json events under a top-level "hooks" key#56
robercano-ghbot merged 1 commit into
mainfrom
fix/plugin-hooks-json-schema

Conversation

@robercano-ghbot

Copy link
Copy Markdown
Collaborator

Summary

Claude Code's plugin hooks/hooks.json schema requires the event map (PostToolUse, Stop, etc.) nested under a top-level "hooks" key — same shape as the hooks field inside settings.json. Ours had PostToolUse/Stop directly at the root, which fails plugin load for every consumer:

Failed to load hooks from .../hooks/hooks.json: [{"expected":"record","code":"invalid_type","path":["hooks"],"message":"Invalid input: expected record, received undefined"}]

Caught while enabling the plugin in reDeploy (first real external consumer of the plugin install path).

Fix

Wrap the existing event map in {"hooks": {...}}. No behavioral change to the hooks themselves — same matchers, same commands.

Test plan

  • JSON validates, top-level key is now ["hooks"]
  • GATES_FILE=.claude/self/gates.json gate.sh lint passes
  • GATES_FILE=.claude/self/gates.json gate.sh test passes

… key

Claude Code's plugin hooks.json schema requires the event map (PostToolUse,
Stop, etc.) nested under a top-level "hooks" key -- same shape as the hooks
field inside settings.json. Ours had PostToolUse/Stop directly at the root,
which fails plugin load for every consumer with:

  Failed to load hooks from .../hooks/hooks.json: [{"expected":"record",
  "code":"invalid_type","path":["hooks"],"message":"Invalid input: expected
  record, received undefined"}]

Caught while enabling the plugin in reDeploy.
@robercano-ghbot
robercano-ghbot merged commit 3b8064e into main Jul 6, 2026
9 checks passed
@robercano-ghbot
robercano-ghbot deleted the fix/plugin-hooks-json-schema branch July 6, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants